package com.test.daily.leetcode.y2022.m07.day0701.v09;

/**
 * @author Tom on 2022/7/3
 */
public class Solution {
    public boolean isExistent(int[] arr, int target){
        int L = 0, R = arr.length - 1, mid = 0;
        while(L < R){
            mid = L + ((R - L) >> 1);
            if(arr[mid] == target){
                return true;
            } else if(arr[mid] > target){
                R = mid - 1;
            } else {
                L = mid + 1;
            }
        }
        return arr[L] == target;
    }
}
